<div class="content-wrapper">
    <?php
    $form = $this->form;
    $form->prepare();
    ?>
    <?php echo $this->form()->openTag($form); ?>
    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right" id="dbshop-menu-top">
            <?php echo $this->HelpUrl('serviceBind'); ?>
        </h1>
    </section>

    <section class="content">
        <div class="row">
            <div class="col-md-12">
                <div class="box box-primary">
                    <div class="box-header with-border">
                        <h3 class="box-title"><?php echo $this->translate('服务绑定'); ?></h3>
                    </div>

                    <div class="box-body">
                        <?php echo $this->partial('layout/messages'); ?>
                        <blockquote>
                            <p class="text-red"><?php echo $this->translate('特别注意：底部保留官方版权信息，官方允许您免费(商用)使用本系统。如果修改版权信息，请向官方购买授权。'); ?> <a href="https://www.dberp.net/" class="btn btn-sm btn-danger" target="_blank"><?php echo $this->translate('点击查看授权购买'); ?></a></p>
                            <p class="text-green"><?php echo $this->translate('服务绑定(永久免费)非常重要，绑定后可以在线 更新、安装插件，获取更多官方提供的便捷服务。'); ?> <a href="https://docs.dberp.net/dberp/system/service-bind.html" class="btn btn-sm btn-success" target="_blank"><?php echo $this->translate('点击查看绑定方法'); ?></a></p>
                        </blockquote>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('珑大会员账号'); ?><span class="must_add_value">*</span></label>
                            <div class="col-sm-5">
                                <?php echo $this->formElement($form->get('userName')); ?>
                                <?php echo $this->formElementErrors($form->get('userName'), ['class'=>'error-message']); ?>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label"><?php echo $this->translate('网站标识码'); ?><span class="must_add_value">*</span></label>
                            <div class="col-sm-5">
                                <?php echo $this->formElement($form->get('code')); ?>
                                <?php echo $this->formElementErrors($form->get('code'), ['class'=>'error-message']); ?>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-5">
                                <button type="submit" class="btn btn-primary"><i class="fa fa-check"></i> <?php echo $this->translate('点击绑定'); ?></button>
                            </div>
                        </div>
                    </div>

                </div>
            </div>
        </div>

    </section>
    <?php echo $this->form()->closeTag(); ?>
</div>
<script type="text/javascript">
    $(document).ready(function() {
        $("#<?php echo $form->getName(); ?>").validate({
            rules: {
                userName: {
                    required: true
                },
                code: {
                    required: true
                }
            },
            messages: {
                userName: {
                    required: "<?php echo $this->translate('珑大会员账号不能为空!'); ?>"
                },
                code: {
                    required: "<?php echo $this->translate('网站标识码不能为空!'); ?>"
                }
            }
        });
    });
</script>